package com.tianji.exam.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.exam.domain.vo.ExamDetailVO;
import com.tianji.exam.domain.vo.ExamPageVO;
import com.tianji.exam.service.IExamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 考试表 前端控制器
 * </p>
 *
 * @author author
 * @since 2023-04-26
 */
@RestController
@RequestMapping("/exams")
@Api(tags = "考试相关接口")
@RequiredArgsConstructor
public class ExamController {

    private final IExamService examService;

    @GetMapping("page")
    @ApiOperation("分页查询考试记录")
    public PageDTO<ExamPageVO> queryPageExam(PageQuery query){
        return examService.queryPageExam(query);
    }

    @GetMapping("{id}")
    @ApiOperation("根据考试记录id，查询考试详情")
    public ExamDetailVO queryExamDetailById(@PathVariable("id") Long id){
        return examService.queryExamDetailById(id);
    }
}
